
[dbo].[TaxAuthorityFinancialEntity]
CREATE TABLE [dbo].[TaxAuthorityFinancialEntity]
(
[TaxAuthorityFinancialEntityKey] [uniqueidentifier] NOT NULL CONSTRAINT [DF_TaxAuthorityFinancialEntity_TaxAuthorityFinancialEntityKey] DEFAULT (newid()),
[TaxAuthorityKey] [uniqueidentifier] NOT NULL,
[FinancialEntityKey] [uniqueidentifier] NOT NULL,
[TaxRegistrationID] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TaxLiabilityGLAccountKey] [uniqueidentifier] NULL,
[UpdatedByUserKey] [uniqueidentifier] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[CreatedByUserKey] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[MarkedForDeleteOn] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TaxAuthorityFinancialEntity] ADD CONSTRAINT [PK_TaxAuthorityFinancialEntity] PRIMARY KEY CLUSTERED ([TaxAuthorityFinancialEntityKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TaxAuthorityFinancialEntity_CreatedByUserKey] ON [dbo].[TaxAuthorityFinancialEntity] ([CreatedByUserKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TaxAuthorityFinancialEntity_UpdatedByUserKey] ON [dbo].[TaxAuthorityFinancialEntity] ([UpdatedByUserKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TaxAuthorityFinancialEntity] ADD CONSTRAINT [FK_TaxAuthorityFinancialEntity_UserMain_CreatedBy] FOREIGN KEY ([CreatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[TaxAuthorityFinancialEntity] ADD CONSTRAINT [FK_TaxAuthorityFinancialEntity_UserMain_UpdatedBy] FOREIGN KEY ([UpdatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO